
clear all
clear mata
clear matrix
set more off
set scheme modern

*set path here*

global rawdata = 
global workingdata = 
global match = 
global temp = 
global table = 

********************************************
*match the weather data to each CFPS county*
********************************************

use $rawdata\countyid_countycode.dta, clear

joinby countycode using $rawdata\weather.dta, unmatched(none)

sort countyid day

drop province-countycode

save $match\weather.dta, replace

****************************************
*match the API data to each CFPS county*
****************************************

use $rawdata\countyid_countycode.dta, clear

joinby countycode using $rawdata\API.dta, unmatched(none)

sort countyid day

drop province-countycode

save $match\API.dta, replace
